

<template>
  <div class="erpField">
    <DFPageList ref="dfPageListRef" :page-options="pageOptions" />
  </div>
</template>

<script lang="ts" setup name="ErpField">
import lang from './lang'
import { addErpField, delErpField, pageErpField, updateErpField } from '@/api/system/erpField'
import { useMixins } from '@/hooks/useMixins'

const { loadLangFn } = useMixins()

const dfPageListRef: any = ref(null)

loadLangFn(lang)

const pageOptions = {
  searchForm: {
    formSchemas: [
      {
        label: 'field',
        component: 'NInput',
      },
    ],
  },
  table: {
    columns: [
      {
        width: 120,
        label: 'field',
      },
      {
        width: 120,
        label: 'newField',
      },
      {
        width: 120,
        label: 'remark',
        common: true,
      },
    ],
    action: {
      columns: [
        {
          label: 'edit',
        },
        {
          label: 'delete',
        },
      ],
    },
    operaColumn: [
      {
        label: 'add',
      },
    ],
    requestFn: pageErpField,
    delRequestFn: delErpField,
  },
  modalFormDialog: {
    formSchemas: [
      {
        label: 'field',
        editDialogDisabled: true,
        required: true,
      },
      {
        label: 'newField',
        editDialogDisabled: true,
        required: true,
      },
      {
        label: 'remark',
        common: true,
        type: 'textarea',
      },
    ],
    addDataFn: addErpField,
    updateDataFn: updateErpField,
  },
}

// nextTick(() => {
//   dfPageListRef.value && dfPageListRef.value.openModalFn();
// });
</script>
